// wenshidu/cunxq/cunxq.js
let app = getApp()
let yuming = app.globalData.yuming
const request = require('../../config/request');
Page({
  ...request,
  /**
   * 页面的初始数据
   */
  data: {
    yuming: yuming,
    title: '库存',
    xq: '',
    number_drugs: '',
    page: 1
  },
  // 返回
  backs() {
    wx.navigateBack({
      delta: 0
    })
  },
  cunxq() {
    this.myRequest(yuming + 'Shop/shop_jxckc_allyiyao', {
      shopId: wx.getStorageSync('shopId'),
      number_drugs: this.data.number_drugs,
      page: this.data.page
    }, "POST").then(res => {
      console.log(res)
      var ShopJxc = res.data.data.ShopJxc
      var ShopJxckc = res.data.data.ShopJxckc
      this.setData({
        ShopJxc,
        ShopJxckc
      })
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      heights: wx.getMenuButtonBoundingClientRect().top + 5,
      xq: wx.getStorageSync('gongying_xq'),
      number_drugs: options.bian
    })
    this.cunxq()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },
})